﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.VideoDownload
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.VideoDownload;

    public class map_VideoServer: EntityMapping<VideoServer>
    {
        public map_VideoServer()
        {
            Bag(x => x.Cameras, map =>
            {
                map.Key(keyMapper => keyMapper.Column("ServerId"));
            }, rel => rel.OneToMany());

            Property(x => x.Host, map =>
            {
                map.Length(40);
            });

            Property(x => x.Name, map =>
            {
                map.Length(200);
            });

            Property(x => x.Password, map =>
            {
                map.Length(20);
            });

            Property(x => x.Port, map =>
            {
                map.Length(20);
            });

            Property(x => x.UserName, map =>
            {
                map.Length(40);
            });
        }
    }
}
